home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / IC Random Signature ƒ / IC Specific Override.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-17  |  3.1 KB  |  91 lines  |  [TEXT/SPM ]

  1. /*
  2.     IC Specific Override.h
  3.     
  4.     Header file for IC Specific Override.c
  5.     
  6. */
  7.  
  8. #pragma once
  9.  
  10. #ifndef __H_IC_Specific_Override__
  11. #define __H_IC_Specific_Override__
  12.  
  13. #define kOurComponentManufacturer 'JMJ '
  14. // You must set this up appropriately. Things will not be good otherwise.
  15.  
  16. #define delegateThisCallErr 0x81234568
  17. // Return this from a component routine if you want the generic override
  18. // component to pass this call through to the captured component.
  19.  
  20. #define kRandomSigFoldName 130
  21. #define kDefaultSignature 128
  22.  
  23. struct SharedGlobalsStruct {
  24.     Component delegate;
  25.     
  26.     // add your own shared globals here
  27.     
  28. };
  29.  
  30. typedef struct SharedGlobalsStruct SharedGlobals,* SharedGlobalsPtr;
  31.  
  32. struct GlobalsRecordStruct {
  33.     ComponentInstance self;
  34.     ComponentInstance target;
  35.     ComponentInstance delegate;
  36.     SharedGlobalsPtr shared;
  37.     
  38.     // add your own component specific globals here
  39.     
  40.     Handle current_signature;
  41.     Handle default_signature;
  42.     Str63 sig_folder_name;
  43.     long random_seed;
  44. };
  45.  
  46. typedef struct GlobalsRecordStruct GlobalsRecord,* GlobalsPtr,** GlobalsHandle;
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. // Except when otherwise noted the globals handle is locked when any of these routines are called.
  53.  
  54. pascal ComponentResult ICSOInitShared(GlobalsHandle globals);
  55. // This routine is called to init the shared globals.  If you return an error then you should make
  56. // sure your part ofthe shared globals are 'clean'.
  57.  
  58. pascal ComponentResult ICSOCleanShared(GlobalsHandle globals);
  59. // This routine is called to clean the shared globals.
  60. // WARNING:  This will never been called if you're using an old version of the Component Manager.
  61. // Workaround: If your specifics only bleeds small amounts of memory then don't worry. If your
  62. // specifics bleeds a lot of memory or other resources (such as open files) then refuse to install
  63. // with older Component Managers (I think it was fixed in v2 of the manager).
  64.  
  65. pascal ComponentResult ICSOInitGlobals(GlobalsHandle globals);
  66. // This routine inits the override specific fields of the component specific globals. If it returns an
  67. // error then the globals must be 'clean'.
  68.  
  69. pascal ComponentResult ICSOCleanGlobals(GlobalsHandle globals);
  70. // This routine cleans up the component specific globals, disposing any pointers and otherwise
  71. // releasing any allocated resources.
  72.  
  73. pascal ComponentResult ICSOCanDo(GlobalsHandle globals,short selector);
  74. // This routine is called in response to a component can do request.  You should set component result to:
  75. //   -1 if you definitely want to say that the component can't do this
  76. //     0 if you definitely want to say that the component can do this
  77. //     1 if you want to let the target decide
  78. // WARNING: These constants are quite different from the constants used by a standard
  79. // Component Manager CanDo request.
  80.  
  81. pascal ComponentFunctionUPP ICSOWhatToOverride(GlobalsHandle globals,short selector);
  82. // Return nil if you do not want to override this what.  Return a pointer to a procedure with the
  83. // appropriate signature if you do.
  84. // WARNING: globals will not necessarily be locked and may be nil!!!
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89.  
  90. #endif /* __H_IC_Specific_Override__ */
  91.